@echo off
setlocal
call :url_prompt
set stsadm="C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN\"
echo.

echo adding solution Chaks.SharePoint.Docs.ILP.wsp ...
%stsadm%\stsadm -o addsolution -filename Chaks.SharePoint.Docs.ILP.wsp

echo deploying solution Chaks.SharePoint.Docs.ILP.wsp to %webappurl% ...
%stsadm%\stsadm -o deploysolution -name Chaks.SharePoint.Docs.ILP.wsp -allowGacDeployment -local -url %webappurl%

echo activating Site level Item-level permission features at %webappurl% ...
echo.
echo feature: ILP_SiteColumns
%stsadm%\stsadm -o activatefeature -filename "ILP_SiteColumns\feature.xml" -url %webappurl% -force
echo feature: ILP_ContentTypes_ILPItem
%stsadm%\stsadm -o activatefeature -filename "ILP_ContentTypes_ILPItem\feature.xml" -url %webappurl% -force
echo feature: ILP_ListInstances_ILPSet
%stsadm%\stsadm -o activatefeature -filename "ILP_ListInstances_ILPSet\feature.xml" -url %webappurl% -force

echo activating Web level Item-level permission features at %siteurl%
echo.
echo feature: ILP_CustomActions_LibrarySettings
%stsadm%\stsadm -o activatefeature -filename "ILP_CustomActions_LibrarySettings\feature.xml" -url %siteurl% -force

echo Thank You for installing Item-level Permission settings for Document Libraries
echo.
echo.

echo Performing iisreset...
echo.
iisreset

GOTO:EOF

:url_prompt
echo Enter URL of the web application (e.g., http://mysite):
set /p webappurl=
echo.
echo Enter the relative URL of the web in the web application (e.g., /myweb):
set /p siteurl=
set siteurl=%webappurl%%siteurl%
GOTO:EOF

:end
echo Please input your site and web url
echo usage - install.bat http://mysiteurl /weburl
@pause

